<?php
    include('_connect.php');

    $username = $_REQUEST['username'];
    $sql = "select * from gzxtable2 where username='$username'";

    $res = $mysqli->query($sql);
    // var_dump($res);
    if($res->num_rows>0){
        echo '{"msg":"用户名已存在","has":true,"status":200}';//打印个json字符串
    }else{
        echo '{"msg":"用户名可以使用","has":false,"status":200}';
    }
?>